From 68b564efee06fa8a5118004d8d78b2c0a20b5096 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Fri, 31 Mar 2006 12:03:42 +0100 Subject: [PATCH] Various softirq cleanups: 1. Make __softirq_pending a long, since PPC borrows the file hardirq.h from us and they only do atomic ops on longs. 2. do_softirq() explicitly takes a void param list. 3. Remove idle_timestamp field from irq_cpustat. It's unused and lets us simplify the idle loop a little bit. Part 1 based on a patch from Hollis Blanchard at IBM. Signed-off-by: Keir Fraser --- xen/arch/x86/domain.c | 11 ++++------- xen/common/softirq.c | 5 +++-- xen/include/asm-x86/hardirq.h | 3 +-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 8cb91ead4d..ab5b697953 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -79,15 +79,12 @@ void idle_loop(void) for ( ; ; ) { - irq_stat[cpu].idle_timestamp = jiffies; + page_scrub_schedule_work(); - while ( !softirq_pending(cpu) ) - { - page_scrub_schedule_work(); - default_idle(); - } + default_idle(); - do_softirq(); + if ( softirq_pending(cpu) ) + do_softirq(); } } diff --git a/xen/common/softirq.c b/xen/common/softirq.c index 5a7cd2dabc..f8a2c3780c 100644 --- a/xen/common/softirq.c +++ b/xen/common/softirq.c @@ -21,9 +21,10 @@ irq_cpustat_t irq_stat[NR_CPUS]; static softirq_handler softirq_handlers[NR_SOFTIRQS]; -asmlinkage void do_softirq() +asmlinkage void do_softirq(void) { - unsigned int i, pending, cpu = smp_processor_id(); + unsigned int i, cpu = smp_processor_id(); + unsigned long pending; pending = softirq_pending(cpu); ASSERT(pending != 0); diff --git a/xen/include/asm-x86/hardirq.h b/xen/include/asm-x86/hardirq.h index 59e90e2b47..c426fdea07 100644 --- a/xen/include/asm-x86/hardirq.h +++ b/xen/include/asm-x86/hardirq.h @@ -5,10 +5,9 @@ #include typedef struct { - unsigned int __softirq_pending; + unsigned long __softirq_pending; unsigned int __local_irq_count; unsigned int __nmi_count; - unsigned long idle_timestamp; } __cacheline_aligned irq_cpustat_t; #include /* Standard mappings for irq_cpustat_t above */ -- 2.30.2